package com.tekj.cxqcb.view.Module.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.squareup.picasso.Picasso;
import com.tekj.cxqcb.R;
import com.tekj.cxqcb.operation.resultBean.SelectUserBankListBean;

import java.util.List;

/**
 * 银行卡列表adapter
 */
public class BankCardListAdapter extends BaseQuickAdapter<SelectUserBankListBean.DataBean.ListBean, BaseViewHolder> {

    public BankCardListAdapter(@Nullable List<SelectUserBankListBean.DataBean.ListBean> data) {
        super(R.layout.item_bank_card, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, SelectUserBankListBean.DataBean.ListBean item) {

        Picasso.get().load(item.getLogo())
//                .resize(1280, 1280)
                .into((ImageView) helper.getView(R.id.img_logo));

        helper.setText(R.id.tv_name, item.getBankName());

        helper.setText(R.id.tv_num, item.getCardNumber());

        helper.setGone(R.id.tv_default, item.getIsDefault() == 1);

    }
}
